# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=stellarium
pkgver=0.20.1
pkgrel=0
pkgdesc="A stellarium with great graphics and a nice database of sky-objects"
url="http://stellarium.org/"
arch="all !mips !mips64 !armhf" # Limited by qt5-qtmultimedia-dev
license="GPL-2.0-or-later"
makedepends="
	cmake boost-dev mesa-dev qt5-qttools-dev libpng-dev freetype-dev
	openssl-dev qt5-qtscript-dev qt5-qtserialport-dev qt5-qtmultimedia-dev
	qt5-qtlocation-dev gpsd-dev
"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/Stellarium/stellarium/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
"

build() {
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DENABLE_TESTING=1 \
		.
	make
}

check() {
	[ "$CARCH" = "x86" ] && return 0
	# Exclude a broken locale test
	ctest -E 'test(INDIConnection|TelescopeControl_INDI|TelescopeClientINDI|StelSkyCultureMgr)'
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="685a306391dc681cc21834a226e35c769e11909f625ff7461d7e896ba412ad595871e93c69981b342099f46829f9f3ef3e276be867dc5ea5523fa60a99cc21d1  stellarium-0.20.1.tar.gz"
